<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/7/6
 * Time: 11:04
 */

namespace app\admin\controller;


use app\admin\model\PropExchange;
use think\App;
use app\admin\model\Prop as PropModel;
class Prop extends Index
{
    protected $propModel;
    protected $propExchangeModel;
    public function __construct(PropModel $propModel,PropExchange $propExchangeModel)
    {
        $this->propModel = $propModel;
        $this->propExchangeModel = $propExchangeModel;
    }

    public function index()
    {
        return view();
    }

    public function indexData()
    {
        $propModel = $this->propModel;
        $data = $propModel->indexData();
        return json($data);
    }

    //上下架
    public function changeStatus()
    {
        $propModel = $this->propModel;
        $res = $propModel->changeStatus();
        return $res;
    }
    //道具添加
    public function PropAdd()
    {
        $propModel = $this->propModel;
        $res = $propModel->PropAdd();
        return $res;
    }

    //兑换列表
    public function propExchangeIndex()
    {
        return view();
    }

    //兑换列表
    public function propExchangeIndexData()
    {
        $propExchangeModel =  $this->propExchangeModel;
        $data = $propExchangeModel->IndexData();
        return json($data);
    }

    public function propExchangeAdd()
    {
        $propExchangeModel =  $this->propExchangeModel;
        $res = $propExchangeModel->propExchangeAdd();
        return $res;
    }

    public function propExchangeChangeStatus()
    {
        $propExchangeModel =  $this->propExchangeModel;
        $res = $propExchangeModel->changeStatus();
        return $res;
    }




}